package org.example.lethear.dto.post;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 帖子DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PostDTO {
    
    private Long id;
    private String title;
    private String content;
    private String summary;
    private String imageUrl;
    private String videoUrl;
    private List<String> tags;
    private Integer status; // 0: 草稿, 1: 发布, 2: 隐藏
    private Boolean isTop;
    private Boolean allowComment;
    private Long viewCount;
    private Long commentCount;
    private Long likeCount;
    private Integer priority;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    
    /**
     * 作者信息
     */
    private AuthorInfo author;
    
    /**
     * 分类信息
     */
    private CategoryInfo category;
    
    /**
     * 当前用户是否点赞
     */
    private Boolean isLiked;
    
    /**
     * 当前用户是否收藏
     */
    private Boolean isFavorited;
    
    /**
     * 作者信息内部类
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class AuthorInfo {
        private Long id;
        private String username;
        private String nickname;
        private String avatar;
    }
    
    /**
     * 分类信息内部类
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class CategoryInfo {
        private Long id;
        private String name;
        private String description;
        private String icon;
        private String color;
    }
} 